package model;

import java.io.DataOutputStream;
import java.io.IOException;
import java.net.Socket;

public class FluxoSaida{

	private DataOutputStream outToServer;
	private String nome;
	
	public FluxoSaida(Socket socket,String nome){
		try{
			this.nome=nome;
			this.outToServer=new DataOutputStream(socket.getOutputStream());
		}catch(IOException ioe){}
	}
	
	public DataOutputStream getOutToServer() {
		return this.outToServer;
	}
	
	public void escreve(String sentence){
		try{
			this.getOutToServer().writeBytes(this.nome+":"+sentence+'\n');
		}catch(IOException ioe){}	
	}

	public String getNome() {
		return this.nome;
	}

	public void setNome(String nome) {
		this.nome = nome;
	}
}
